import React, { Component } from 'react';
import './WyTitle.scss';

//使用ant-designed-mobile组件
import { NavBar, Icon } from "antd-mobile";
import { withRouter } from "react-router-dom";

class WyTitle extends Component {
    render() {
        return (
            <NavBar
            mode="light"
            icon={this.props.left ? <Icon type="left" /> : ""}
            onLeftClick={() => this.props.history.go(-1)}
          >
            {this.props.title}
          </NavBar>
        )
    }
}
export default withRouter(WyTitle)
